package com.angel.healthReport;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import com.angel.core.util.JsonUtil;
import com.angel.core.util.MatcherUtil;
import com.angel.health.BuzFactors;
import com.angel.health.BuzMedicalContent;
import com.github.pagehelper.StringUtil;

/**
 * @author 作者姓名 cheng
 * @version 创建时间：2016年10月1日 下午11:32:33 类说明
 */
public class HeathReport {

	/**
	 * 为获取指标对应正常参数和单位写入键值对
	 * 
	 * @param contentList
	 * @return
	 */
	public static Map<String, BuzMedicalContent> medicalContent(List<BuzMedicalContent> contentList) {
		Map<String, BuzMedicalContent> map = new HashMap<String, BuzMedicalContent>();
		for (BuzMedicalContent bmc : contentList) {
			map.put(bmc.getName().trim(), bmc);
		}
		return map;
	}

	/**
	 * 体检结果部分
	 * 
	 * @param medical
	 * @return
	 */
	// public static Map<String, String> generateReport(String medical, String
	// medicalTime,
	// Map<String, BuzMedicalContent> map, int sex) {
	// Map<String, String> resultMap = new HashMap<String, String>();
	// StringBuffer sb = new StringBuffer();
	//// String importantIndicator = "";
	// String bmi = "";
	// /**
	// * key:体检项目名称 value:指标结果集
	// */
	// Map<String, Object> subjectsMap = JsonUtil.jsonToMap(medical);
	// for (Entry<String, Object> entry : subjectsMap.entrySet()) {
	// StringBuffer _sb = new StringBuffer();
	// String key = entry.getKey();
	// Object value = entry.getValue();
	// _sb.append("<div style=\"padding-top: 25px\">");
	// _sb.append("<span style=\"margin: 0 20px; color: #3aa5de; font-size:
	// 16px;\"><b>");
	// _sb.append(key);
	// _sb.append("</b></span>");
	// _sb.append(
	// "<span style=\"padding-left: 8px; color:
	// #e6e7e9\">/////////////////////////////////////////////////////////////////////</span></div>");
	// _sb.append("<div style=\"margin-top: 29px; margin: 0px 30px;\">");
	// _sb.append("<p style=\"font-size: 14px; float: right; margin: 5px 0px;
	// padding-right: 30px\">");
	// _sb.append("<b><span style=\"margin-right: 40px\">检查日期：<span>" +
	// medicalTime
	// + "</span></span>检查医生：<span>【jcys】</span></b></p>");
	// _sb.append(
	// "<table width=\"100%\" cellspacing=\"0\" style=\"clear: both; text-align:
	// center; border: 1px solid #f0f1f3; height: auto; font-size: 13px;
	// line-height: 28px; color: #464646\">");
	// _sb.append("<tr style=\"background:#e0691d;color:#fff\">");
	// if("内科".equals(key) || "外科".equals(key) || "眼科".equals(key) ||
	// "腹部超声".equals(key) || "盆腔超声".equals(key) || "泌尿系超声".equals(key) ||
	// "胸部摄片".equals(key)){
	// _sb.append("<th width=\"35%\" style=\"border-right:1px solid
	// #fff\">项目名称</th>");
	// _sb.append("<th width=\"65%\" style=\"border-right:1px solid
	// #fff\">检查结果</th>");
	// }else{
	// _sb.append("<th width=\"25%\" style=\"border-right:1px solid
	// #fff\">项目名称</th>");
	// _sb.append("<th width=\"25%\" style=\"border-right:1px solid
	// #fff\">检查结果</th>");
	// _sb.append("<th width=\"25%\" style=\"border-right:1px solid
	// #fff\">参考范围</th>");
	// _sb.append("<th width=\"25%\">单位</th>");
	// }
	// _sb.append("</tr>");
	// Map<String, Object> contentMap = JsonUtil.jsonToMap(value.toString());
	// int i = 0;
	// String tjsj = "";
	// String jcys = "";
	// for (Entry<String, Object> contentEntry : contentMap.entrySet()) {
	// String _key = contentEntry.getKey().trim();
	// String _value = contentEntry.getValue().toString().trim();
	// _value = StringUtil.isEmpty(_value) || "null".equals(_value)
	// ||"\"null\"".equals(_value) ? "":_value;
	// if ("tjsj".equals(_key)) {
	// tjsj = _value;
	// continue;
	// }
	// if ("jcys".equals(_key)) {
	// jcys = _value;
	// continue;
	// }
	// if(_key.indexOf("复测")>= 0){
	// continue;
	// }
	// //start 写入阳性发现异常数据 ----体重BMI，胆固醇，血脂，甘油三脂
	//// if ("体检血压(收缩压)".equals(_key)) {
	//// if (Float.parseFloat(_value) < 18.5 ) {
	//// positiveFind += "体重偏瘦,";
	//// }else if(Float.parseFloat(_value) > 23.99 && Float.parseFloat(_value) <
	// 40){
	//// positiveFind += "体重偏胖,";
	//// }else{
	//// positiveFind += "体重超重,";
	//// }
	//// bmi = _value;
	//// } else if ("总胆固醇（TC） ".equals(_key) && Float.parseFloat(_value) >=
	// 5.18) {
	//// positiveFind += "胆固醇（TC）偏高,";
	//// } else if ("血脂 ".equals(_key) && Float.parseFloat(_value) >= 6.0) {
	//// positiveFind += "血脂偏高,";
	//// } else if ("甘油三酯（TG） ".equals(_key) && Float.parseFloat(_value) >= 1.7)
	// {
	//// positiveFind += "甘油三酯（TG）偏高,";
	//// }
	// //end 写入阳性发现异常数据 ----体重BMI，胆固醇，血脂，甘油三脂
	// if (i == 0) {
	// _sb.append("<tr>");
	// i = 1;
	// } else {
	// _sb.append("<tr style=\"background: #cfe0f1; color: #1176a8\">");
	// i = 0;
	// }
	// if("内科".equals(key) || "外科".equals(key) || "眼科".equals(key) ||
	// "腹部超声".equals(key) || "盆腔超声".equals(key) || "泌尿系超声".equals(key) ||
	// "胸部摄片".equals(key)){
	// _sb.append("<td width=\"35%\" style=\"border-right: 1px solid
	// #e1ecf7;\">" + _key + "</td>");
	// _sb.append("<td width=\"65%\" style=\"border-right: 1px solid
	// #e1ecf7;\">" + _value + "</td>");
	// }else{
	// String min = "";
	// String max = "";
	// String unit = "";
	// BuzMedicalContent bmc = map.get(_key);
	// if (bmc != null) {
	// if (sex == 1) {
	// min = bmc.getScopeManMin();
	// max = bmc.getScopeManMax();
	// } else if (sex == 2) {
	// min = bmc.getScopeWomenMin();
	// max = bmc.getScopeWomenMax();
	// } else {
	// min = bmc.getScopeManMin();
	// max = bmc.getScopeManMax();
	// }
	// unit = bmc.getUnit();
	// }
	//
	// String zccs = min + "-" + max;
	// if ("-".equals(zccs)) {
	// zccs = "--";
	// }
	// try{
	// if(Float.parseFloat(_value) > Float.parseFloat(max)){
	// _value = _value+"<img style=\"position:absolute;left:65px;top:7px;\"
	// src=\"to_top.png\" />";
	// }else if(Float.parseFloat(_value) < Float.parseFloat(min)){
	// _value = _value+"<img style=\"position:absolute;left:65px;top:7px;\"
	// src=\"to_up.png\" />";
	// }
	// }catch(Exception e){
	// }
	// _sb.append("<td width=\"25%\" style=\"border-right: 1px solid
	// #e1ecf7;padding:0 10px;\">" + _key + "</td>");
	// _sb.append("<td width=\"25%\" style=\"border-right: 1px solid
	// #e1ecf7;\"><span style=\"position:relative;display:inline-block;\">" +
	// _value + "</span></td>");
	// _sb.append("<td width=\"25%\" style=\"border-right: 1px solid
	// #e1ecf7;\">" + zccs + "</td>");
	// _sb.append("<td width=\"25%\">" + unit + "</td>");
	// }
	// _sb.append("</tr>");
	//
	// }
	// if (!"".equals(tjsj)) {
	// _sb.append("<tr><td width=\"25%\" colspan='4' style=\"text-align: center;
	// color: #595858\">小结：" + tjsj
	// + "<span></span></td></tr>");
	// }
	// _sb.append("</table></div>");
	//
	// String hr = _sb.toString().replace("【jcys】", jcys);
	// sb.append(hr);
	// }
	//// resultMap.put("importantIndicator",
	//// StringUtil.isEmpty(importantIndicator) ? "暂无" :
	// importantIndicator.substring(0, importantIndicator.length() - 1));
	// resultMap.put("medical", sb.toString());
	// resultMap.put("bmi", StringUtil.isEmpty(bmi) ? "0" : bmi);
	// return resultMap;
	// }

	public static Map<String, String> generateReport(String medical, String medicalTime,
			Map<String, BuzMedicalContent> map, int sex) {
		Map<String, String> resultMap = new HashMap<String, String>();
		StringBuffer sb = new StringBuffer();
		// String importantIndicator = "";
		String bmi = "";
		/**
		 * key:体检项目名称 value:指标结果集
		 */
		Map<String, Object> subjectsMap = JsonUtil.jsonToMap(medical);
		for (Entry<String, Object> entry : subjectsMap.entrySet()) {
			StringBuffer _sb = new StringBuffer();
			String key = entry.getKey();
			Object value = entry.getValue();
			_sb.append("<div style=\"margin:0px 10px;\">");
			_sb.append(
					"<p style=\"padding:0px;margin-bottom:5px;font-size:14px;float:left;width:25%;text-align:center;color:#083aa0\"><span>");
			_sb.append(key);
			_sb.append("</span></p>");
			_sb.append(
					"<p style=\"font-size:14px;float:right;margin-bottom:5px;padding-right:30px;color:#083aa0\"><b>");
			_sb.append("<span style=\"margin-right:40px\">检查日期：<span>" + medicalTime
					+ "</span></span>检查医生：<span>【jcys】</span></b></p>");
			_sb.append(
					"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"border-top:2px solid #c8c8c8;clear:both;border-bottom:1px solid #ececec;font-size:13px;text-align:center\">");
			_sb.append("<tr style=\"height:28px;background:#f0f0f0\">");
			if ("内科".equals(key) || "外科".equals(key) || "眼科".equals(key) || "腹部超声".equals(key) || "盆腔超声".equals(key)
					|| "泌尿系超声".equals(key) || "胸部摄片".equals(key)) {
				_sb.append("<td style=\"padding:0 10px;width:35%;border-bottom:1px solid #c8c8c8\">项目名称</td>");
				_sb.append("<td style=\"padding:0 10px;width:65%;border-bottom:1px solid #c8c8c8\">检查结果</td>");
			} else {
				_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">项目名称</td>");
				_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">检查结果</td>");
				_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">参考范围</td>");
				_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">单位</td>");
			}
			_sb.append("</tr>");
			Map<String, Object> contentMap = JsonUtil.jsonToMap(value.toString());
			int i = 0;
			String tjsj = "";
			String jcys = "";
			for (Entry<String, Object> contentEntry : contentMap.entrySet()) {
				String _key = contentEntry.getKey().trim();
				String _value = contentEntry.getValue().toString().trim();
				_value = StringUtil.isEmpty(_value) || "null".equals(_value) || "\"null\"".equals(_value) ? "" : _value;
				if ("tjsj".equals(_key)) {
					tjsj = _value;
					continue;
				}
				if ("jcys".equals(_key)) {
					jcys = _value;
					continue;
				}
				if (_key.indexOf("复测") >= 0) {
					continue;
				}
				if (i == 0) {
					_sb.append("<tr style=\"height:28px;\">");
					i = 1;
				} else {
					_sb.append("<tr style=\"height:28px;background:#f0f0f0\">");
					i = 0;
				}
				if ("内科".equals(key) || "外科".equals(key) || "眼科".equals(key) || "腹部超声".equals(key) || "盆腔超声".equals(key)
						|| "泌尿系超声".equals(key) || "胸部摄片".equals(key)) {
					_sb.append(
							"<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + _key + "</td>");
					_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + _value
							+ "</td>");
				} else {
					String min = "";
					String max = "";
					String unit = "";
					BuzMedicalContent bmc = map.get(_key);
					if (bmc != null) {
						if (sex == 1) {
							min = bmc.getScopeManMin();
							max = bmc.getScopeManMax();
						} else if (sex == 2) {
							min = bmc.getScopeWomenMin();
							max = bmc.getScopeWomenMax();
						} else {
							min = bmc.getScopeManMin();
							max = bmc.getScopeManMax();
						}
						unit = bmc.getUnit();
					}

					String zccs = min + "-" + max;
					if ("-".equals(zccs)) {
						zccs = "--";
					}
					_sb.append(
							"<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + _key + "</td>");
					_sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + _value
							+ "</td>");
					_sb.append(
							"<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + zccs + "</td>");
					_sb.append(
							"<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + unit + "</td>");
				}
				_sb.append("</tr>");

			}
			if (!"".equals(tjsj)) {
				if (i == 0) {
					_sb.append("<tr style=\"height:28px;\"><td colspan=\"4\" style=\"text-align:center\">小结：" + tjsj
							+ "</td></tr>");
				} else {
					_sb.append(
							"<tr style=\"height:28px;background:#f0f0f0\"><td colspan=\"4\" style=\"text-align:center\">小结："
									+ tjsj + "</td></tr>");
				}
			}
			_sb.append("</table></div>");

			String hr = _sb.toString().replace("【jcys】", jcys);
			sb.append(hr);
		}
		// resultMap.put("importantIndicator",
		// StringUtil.isEmpty(importantIndicator) ? "暂无" :
		// importantIndicator.substring(0, importantIndicator.length() - 1));
		resultMap.put("medical", sb.toString());
		resultMap.put("bmi", StringUtil.isEmpty(bmi) ? "0" : bmi);
		return resultMap;
	}

	/**
	 * 风险评估参数部分
	 * 
	 * @param riskFactorsList
	 * @param wjMap
	 *            问卷返回数据
	 */
	public static Map<String, String> generateRiskFactors(List<Map<String, Object>> riskFactorsList, int type,
			String medical, Map<String, String> wjMap, int sex) {
		Map<String, String> map = new HashMap<String, String>();

		Map<String, String> contentMap = JsonUtil.jsonStringToMap(medical);
		StringBuffer sb = new StringBuffer();
		int j = 0;
		for (int i = 0; i < riskFactorsList.size(); i++) {
			if (Integer.parseInt(riskFactorsList.get(i).get("type").toString()) != type) {
				continue;
			}
			if (j % 2 == 0) {
				sb.append("<tr style=\"height:28px;background:#f0f0f0\">");
			} else {
				sb.append("<tr style=\"height:28px\">");
			}
			j += 1;
			String name = riskFactorsList.get(i).get("name") == null ? ""
					: riskFactorsList.get(i).get("name").toString().trim().replace("（", "(").replace("）", ")");// 要显示的指标名称
			String medicalValue = "";// 体检结果
			String zccs = "";// 正常范围
			String unit = riskFactorsList.get(i).get("unit") == null ? ""
					: riskFactorsList.get(i).get("unit").toString();// 单位
			String change = riskFactorsList.get(i).get("isChange") == null ? ""
					: riskFactorsList.get(i).get("isChange").toString();
			String min = "";
			String max = "";
			if (sex == 1) {
				min = riskFactorsList.get(i).get("scopeManMin") == null ? ""
						: riskFactorsList.get(i).get("scopeManMin").toString();
				max = riskFactorsList.get(i).get("scopeManMax") == null ? ""
						: riskFactorsList.get(i).get("scopeManMax").toString();
			} else if (sex == 0) {
				min = riskFactorsList.get(i).get("scopeWomenMin") == null ? ""
						: riskFactorsList.get(i).get("scopeWomenMin").toString();
				max = riskFactorsList.get(i).get("scopeWomenMax") == null ? ""
						: riskFactorsList.get(i).get("scopeWomenMax").toString();
			} else {
				min = riskFactorsList.get(i).get("scopeNormalMin") == null ? ""
						: riskFactorsList.get(i).get("scopeNormalMin").toString();
				max = riskFactorsList.get(i).get("scopeNormalMax") == null ? ""
						: riskFactorsList.get(i).get("scopeNormalMax").toString();
			}

			zccs = min + "-" + max;
			if ("-".equals(zccs)) {
				zccs = "--";
			}
			// String contentName = riskFactorsList.get(i).get("contentName") ==
			// null ? ""
			// : riskFactorsList.get(i).get("contentName").toString().trim();//
			// 指标库中配置的标准指标名称
			// if (!StringUtil.isEmpty(contentName)) {// 若不为空，则有对应指标项，为体检数据
			// medicalValue = contentMap.get(contentName) == null ? "" :
			// contentMap.get(contentName);
			// } else {
			if ("性别".equals(name)) {
				medicalValue = wjMap.get("customerSex");
			} else if ("年龄".equals(name)) {
				medicalValue = wjMap.get("customerAge");
				unit = "岁";
			} else if ("高血压家族史".equals(name)) {
				String family = wjMap.get("familyHistory");
				medicalValue = family.indexOf("高血压") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("糖尿病家族史".equals(name)) {
				String family = wjMap.get("familyHistory");
				medicalValue = family.indexOf("糖尿病") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("脑卒中家族史".equals(name)) {
				String family = wjMap.get("familyHistory");
				medicalValue = family.indexOf("脑卒中") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("乳腺癌家族史".equals(name)) {
				String family = wjMap.get("familyHistory");
				medicalValue = family.indexOf("乳腺癌") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("糖尿病".equals(name)) {
				String family = wjMap.get("pastMedicalHistory");
				medicalValue = family.indexOf("糖尿病") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("心脏病".equals(name)) {
				String family = wjMap.get("pastMedicalHistory");
				medicalValue = family.indexOf("心脏病") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("高血压".equals(name)) {
				String family = wjMap.get("pastMedicalHistory");
				medicalValue = family.indexOf("高血压") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("乳腺疾病".equals(name)) {
				String family = wjMap.get("pastMedicalHistory");
				medicalValue = family.indexOf("乳腺") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("高脂血症".equals(name)) {
				String family = wjMap.get("pastMedicalHistory");
				medicalValue = family.indexOf("高脂血症") < 0 ? "无" : "有";
				zccs = "无";
			} else if ("乳腺病手术史".equals(name)) {
				medicalValue = wjMap.get("rxbsss");
				zccs = "无";
			} else if ("吸烟情况".equals(name)) {
				medicalValue = wjMap.get("smoking");
				zccs = "不吸烟";
			} else if ("饮酒情况".equals(name)) {
				medicalValue = wjMap.get("drinking");
				zccs = "不饮酒";
			} else if ("学历".equals(name)) {
				medicalValue = wjMap.get("xueli");
			} else if ("饮食".equals(name)) {
				medicalValue = wjMap.get("diet");
			} else if ("运动指数".equals(name)) {
				medicalValue = "低".equals(wjMap.get("exercise")) ? "" : wjMap.get("exercise");
			} else if ("初潮年龄".equals(name)) {
				medicalValue = wjMap.get("ccnl");
			} else if ("初婚年龄".equals(name)) {
				medicalValue = wjMap.get("chnl");
			} else if ("每日豆类、粗粮摄入量".equals(name)) {
				medicalValue = StringUtil.isEmpty(wjMap.get("spsrl")) ? "" : wjMap.get("spsrl");
			} else if ("雌激素药品".equals(name)) {
				medicalValue = wjMap.get("cjsyp");
			} else if ("熬夜1".equals(name)) {
				medicalValue = wjMap.get("oy1");
			} else if ("熬夜2".equals(name)) {
				medicalValue = wjMap.get("oy2");
			} else {
				medicalValue = contentMap.get(name) == null ? "" : contentMap.get(name);
			}
			// }

			// 若code存在，则该内容为要代入危险因素公式的项目
			String code = riskFactorsList.get(i).get("code") == null ? ""
					: riskFactorsList.get(i).get("code").toString().trim();
			if (!"".equals(code)) {
				map.put(code, medicalValue);
			}
			// sb.append("<td width=\"25%\" style=\"border-right:1px solid
			// #e1ecf7;\">" + name + "</td>");
			// sb.append("<td width=\"25%\" style=\"border-right:1px solid
			// #e1ecf7;\">" + medicalValue + "</td>");
			// sb.append("<td width=\"25%\" style=\"border-right:1px solid
			// #e1ecf7;\">" + zccs + "</td>");
			// sb.append("<td width=\"25%\">" + unit + "</td></tr>");
			if (type == 0 || type == 4) {
				sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + name + "</td>");
				sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + medicalValue
						+ "</td>");
				sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + zccs + "</td>");
				sb.append("<td style=\"padding:0 10px;width:25%;border-bottom:1px solid #c8c8c8\">" + unit + "</td>");
			} else {
				sb.append("<td style=\"padding:0 10px;width:20%;border-bottom:1px solid #c8c8c8\">" + name + "</td>");
				sb.append("<td style=\"padding:0 10px;width:20%;border-bottom:1px solid #c8c8c8\">" + medicalValue
						+ "</td>");
				sb.append("<td style=\"padding:0 10px;width:20%;border-bottom:1px solid #c8c8c8\">" + zccs + "</td>");
				sb.append("<td style=\"padding:0 10px;width:20%;border-bottom:1px solid #c8c8c8\">" + unit + "</td>");
				sb.append("<td style=\"padding:0 10px;width:20%;border-bottom:1px solid #c8c8c8\">" + change + "</td>");
			}

		}
		map.put("html", sb.toString());
		return map;
	}

	/**
	 * 
	 * @param rfMap
	 *            key:需要比对的体检项 value:体检结果
	 * @param farctorsList
	 *            危险因素结果集
	 * @param type
	 * @param result
	 *            不从体检中对比的得分 如性别、高血压家族史、是否吸烟、是否饮酒等
	 */
	public static String getResult(Map<String, String> rfMap, List<BuzFactors> farctorsList, int type, int sex,
			int result) {
		Map<String, List<BuzFactors>> fMap = toMap(farctorsList, type);
		for (Entry<String, String> entry : rfMap.entrySet()) {
			String code = entry.getKey();// 指标
			String medicalCalue = entry.getValue();// 体检结果
			if (StringUtil.isEmpty(medicalCalue)) {
				continue;
			}
			List<BuzFactors> list = fMap.get(code);
			for (BuzFactors bf : list) {
				String value = "";// 得分
				if (sex == 1) {
					value = bf.getManValue();
				} else {
					value = bf.getWomanValue();
				}
				/**
				 * 体检结果存在 并且不需要对比 则为结果集为是|否 ,为true加结果
				 */
				if (bf.getIsCompare() == 0) {
					if ("xueli".equals(code)) {
						if (sex == 1 && ("大学专科".equals(medicalCalue) || "大学本科".equals(medicalCalue)
								|| "研究生".equals(medicalCalue) || "博士".equals(medicalCalue))) {
							result += Integer.parseInt(value);
						} else if (sex != 1 && !"小学".equals(medicalCalue) && !"其他".equals(medicalCalue)) {
							result += Integer.parseInt(value);
						}
					} else if ("diet".equals(code) && "喜咸".equals(medicalCalue)) {
						result += Integer.parseInt(value);
					} else {
						if (!"无".equals(medicalCalue)) {
							result += Integer.parseInt(value);
						}
					}
					break;
				}
				String scope = bf.getScope();
				if (sex != 1) {
					scope = bf.getWomenScope();
				}
				String[] _scope = scope.split("-");
				if (_scope.length == 1 && Float.parseFloat(medicalCalue) >= Float.parseFloat(_scope[0])) {
					result += Integer.parseInt(value);
					break;
				} else if (_scope.length > 1 && Float.parseFloat(medicalCalue) >= Float.parseFloat(_scope[0])
						&& Float.parseFloat(medicalCalue) < Float.parseFloat(_scope[1])) {
					result += Integer.parseInt(value);
					break;
				}
			}
		}

		// DecimalFormat format = new DecimalFormat("0.00");
		// String score = format.format((float) result / 18);
		return getResult(result, type, sex);
	}

	/**
	 * 计算体重区间
	 * 
	 * @param weight_num
	 * @return
	 */
	public static String getDes(double weight_num) {
		String weightDes = "";
		if (weight_num < 18.5) {
			weightDes = "体重过轻<span></span>";
		} else if (weight_num < 23.99) {
			weightDes = "体重正常<span></span>";
		} else if (weight_num < 26.9) {
			weightDes = "肥胖前期<span></span>";
		} else if (weight_num < 29.9) {
			weightDes = "轻度肥胖<span></span>";
		} else if (weight_num < 40) {
			weightDes = "中度肥胖<span style=\"color: #747474;\">（容易生病，要认真减肥，多运动来消耗热量，注意饮食） </span>";
		} else {
			weightDes = "重度肥胖<span style=\"color: #747474;\">（容易生病，要认真减肥，多运动来消耗热量，注意饮食） </span>";
		}
		return weightDes;
	}

	/**
	 * 计算取值范围
	 * 
	 * @param score
	 * @param type
	 * @return
	 */
	private static String getResult(int score, int type, int sex) {
		String result = "0:0";
		if (type == 1 || type == 2) {
			DecimalFormat format = new DecimalFormat("0.00");
			String score1 = "";
			if (type == 1) {
				score1 = format.format((float) score / 18);
			} else {
				score1 = format.format((float) score / 34);
			}
			float _score = Float.parseFloat(score1);
			if (_score < 0.9) {
				result = "低风险:1";
			} else if (_score >= 0.9 && _score < 1.1) {
				result = "中风险:2";
			} else if (_score >= 1.1 && _score < 2.0) {
				result = "高风险:3";
			} else if (_score >= 2.0 && _score < 5.0) {
				result = "极高风险:4";
			} else {
				result = "确认疾病:5";
			}
		} else if (type == 3) {
			result = tnbResult(score, sex);
		}
		return result;
	}

	/**
	 * 计算糖尿病最后的分区间
	 * 
	 * @return
	 */
	private static String tnbResult(int score, int sex) {
		String result = "0:0";
		String _score = "";
		if (sex == 1) {
			if (score < 0) {
				_score = "0.3";
			} else if (score >= 17) {
				_score = "0.3";
			} else {
				switch (score) {
				case 0:
					_score = "0.5";
					break;
				case 1:
					_score = "0.6";
					break;
				case 2:
					_score = "0.8";
					break;
				case 3:
					_score = "1.1";
					break;
				case 4:
					_score = "1.5";
					break;
				case 5:
					_score = "2.1";
					break;
				case 6:
					_score = "2.9";
					break;
				case 7:
					_score = "3.9";
					break;
				case 8:
					_score = "5.4";
					break;
				case 9:
					_score = "7.3";
					break;
				case 10:
					_score = "9.7";
					break;
				case 11:
					_score = "12.8";
					break;
				case 12:
					_score = "16.8";
					break;
				case 13:
					_score = "21.7";
					break;
				case 14:
					_score = "27.7";
					break;
				case 15:
					_score = "35.3";
					break;
				case 16:
					_score = "44.3";
					break;
				default:
					break;
				}
			}
		} else {
			if (score >= 13) {
				_score = "43.1";
			} else {
				switch (score) {
				case -2:
					_score = "0.1";
					break;
				case -1:
					_score = "0.2";
					break;
				case 0:
					_score = "0.2";
					break;
				case 1:
					_score = "0.3";
					break;
				case 2:
					_score = "0.5";
					break;
				case 3:
					_score = "0.8";
					break;
				case 4:
					_score = "1.2";
					break;
				case 5:
					_score = "1.8";
					break;
				case 6:
					_score = "2.8";
					break;
				case 7:
					_score = "4.4";
					break;
				case 8:
					_score = "6.8";
					break;
				case 9:
					_score = "10.3";
					break;
				case 10:
					_score = "15.6";
					break;
				case 11:
					_score = "23.0";
					break;
				case 12:
					_score = "32.7";
					break;
				default:
					break;
				}
			}
		}

		if (Float.parseFloat(_score) < 5) {
			result = "低风险:1";
		} else if (Float.parseFloat(_score) >= 5 && Float.parseFloat(_score) < 20) {
			result = "中风险:2";
		} else if (Float.parseFloat(_score) >= 20 && Float.parseFloat(_score) < 50) {
			result = "高风险:3";
		} else if (Float.parseFloat(_score) >= 50 && Float.parseFloat(_score) < 80) {
			result = "极高风险:4";
		} else {
			result = "确认疾病:5";
		}

		return result;
	}

	/**
	 * 转换为map
	 * 
	 * @param farctorsList
	 * @param type
	 * @return
	 */
	private static Map<String, List<BuzFactors>> toMap(List<BuzFactors> farctorsList, int type) {
		Map<String, List<BuzFactors>> map = new HashMap<String, List<BuzFactors>>();
		for (BuzFactors bf : farctorsList) {
			if (bf.getType() == type) {
				List<BuzFactors> list = new ArrayList<BuzFactors>();
				if (map == null || map.get(bf.getCode()) == null || map.get(bf.getCode()).size() == 0) {
				} else {
					list = map.get(bf.getCode());
				}
				list.add(bf);
				map.put(bf.getCode(), list);
			}
		}
		return map;
	}

	/**
	 * 处理问卷调查
	 * 
	 * @param buzSurvey
	 * @return
	 */
	public static Map<String, String> getWj(Map<String, String> buzSurvey) {
		Map<String, String> map = new HashMap<String, String>();
		String familyHistory = StringUtil.isEmpty(buzSurvey.get("family")) ? "" : buzSurvey.get("family");
		String pastMedicalHistory = StringUtil.isEmpty(buzSurvey.get("history")) ? "" : buzSurvey.get("history");
		String normal = StringUtil.isEmpty(buzSurvey.get("normal")) ? "" : buzSurvey.get("normal");
		Map<String, Object> normalMap = JsonUtil.jsonToMap(normal);
		String smoking = normalMap.get("smork") == null ? "" : normalMap.get("smork").toString();
		String customerSex = normalMap.get("six") == null ? "" : normalMap.get("six").toString();
		String drinking = normalMap.get("beforeDrink") == null ? "" : normalMap.get("beforeDrink").toString();
		String height = normalMap.get("height") == null ? "" : normalMap.get("height").toString();
		String customerAge = normalMap.get("age") == null ? "" : normalMap.get("age").toString();
		String diet = normalMap.get("taste") == null ? "" : normalMap.get("taste").toString();
		String xueli = normalMap.get("culture") == null ? "" : normalMap.get("culture").toString();
		String exercise = normalMap.get("exercisingWay") == null ? "" : normalMap.get("exercisingWay").toString();
		String cjsyp = normalMap.get("estrogen") == null ? "" : normalMap.get("estrogen").toString();
		String occasionallyOil = normalMap.get("occasionallyOil") == null ? ""
				: normalMap.get("occasionallyOil").toString();
		String oftenOil = normalMap.get("oftenOil") == null ? "" : normalMap.get("oftenOil").toString();
		String ccnl = normalMap.get("firstMenstrualAge") == null ? "" : normalMap.get("firstMenstrualAge").toString();
		String chnl = normalMap.get("firstMarriage") == null ? "" : normalMap.get("firstMarriage").toString();
		String rxbsss = normalMap.get("mastopathyHistory") == null ? "" : normalMap.get("mastopathyHistory").toString();
		String dh = normalMap.get("dh") == null ? "" : normalMap.get("dh").toString();

		map.put("familyHistory", familyHistory);
		map.put("pastMedicalHistory", pastMedicalHistory);
		// map.put("normal", normal);
		map.put("smoking", smoking);
		map.put("customerSex", customerSex);
		map.put("drinking", drinking);
		map.put("height", height);
		map.put("customerAge", customerAge);
		map.put("diet", diet);
		map.put("xueli", xueli);
		map.put("exercise", exercise);
		map.put("cjsyp", cjsyp);
		map.put("oy1", occasionallyOil);
		map.put("oy2", oftenOil);
		map.put("ccnl", ccnl);
		map.put("chnl", chnl);
		map.put("rxbsss", rxbsss);
		map.put("dh", dh);
		return map;
	}

	public static String generateRiskFactorsRXA(String riskFactors) {
		StringBuffer sb = new StringBuffer();
		sb.append("<div style=\"width: 100%; height: 44px; background: #3aa5de; margin-top: 40px\">");
		sb.append(
				"<span style=\"margin: 0px; padding: 0px; color: #fff; line-height: 54px; padding-left: 30px; font-size: 14px\">评估编号:</span>");
		sb.append("<span style=\"color: #fff; font-size: 14px\">【assessmentCode】</span></div>");
		sb.append("<div style='width: 100%; font-size: 24px; color: #fff; margin-left: 40%; font-weight: bold'>");
		sb.append("<span style=\"background: #3aa5de; padding: 8px; display: inline-block\">NO.4</span>");
		sb.append(
				"<span style=\"margin-left: 10px; line-height: 30px; display: inline-block; color: #3aa5de; font-size: 24px;\">恶性肿瘤</span></div>");
		sb.append("<div style=\"padding-top: 20px\"><div><br/>");
		sb.append(
				"<p style=\"margin: 0px; padding: 0px; display: inline-block; background: url('span_bg.png') no-repeat; width: 216px; height: 41px; line-height: px; color: #fff; font-style: normal\">");
		sb.append("<span style=\"padding-left: 40px; font-size: 20px; line-height: 40px\">乳腺癌风险评估</span></p>");
		sb.append(
				"<p style=\"margin: 0px; padding: 0px; color: #585959; line-height: 20px; font-size: 14px; padding: 10px 30px\">");
		sb.append("&nbsp;&nbsp;女性乳腺是由皮肤、纤维组织、乳腺腺体和脂肪组成的，乳腺癌是发生在乳腺腺上皮组织的恶性肿瘤。乳腺癌中99%发生在女性，男性仅占1%。</p>");
		sb.append("</div></div><div>");
		sb.append(
				"<span style=\"margin-left: 20px; color: #3aa5de; font-size: 16px; display: inline-block; padding: 15px 0px 10px 0px\"><b>主要参数</b></span>");
		sb.append(
				"<span style=\"padding-left: 8px; color: #e6e7e9\">///////////////////////////////////////////////////////////////////////</span></div>");
		sb.append("<div><div style=\"margin-top: 29px; margin: 0px 30px;\">");
		sb.append(
				"<table width=\"100%\" cellspacing=\"0\" style=\"text-align: center; border: 1px solid #f0f1f3; height: auto; font-size: 13px; line-height: 28px\">");
		sb.append(
				"<tr style=\"background: #e0691d; color: #fff\"><th width=\"25%\" style=\"border-right: 1px solid #fff\">指标</th>");
		sb.append(
				"<th width=\"25%\" style=\"border-right: 1px solid #fff\">结果</th><th width=\"25%\" style=\"border-right: 1px solid #fff\">参考</th>");
		sb.append("<th width=\"25%\">单位</th></tr>");
		sb.append(riskFactors);
		sb.append("</table></div></div><div style=\"margin: 15px 30px 0 30px\">");
		sb.append(
				"<ul style=\"margin: 0px; padding: 0px; list-style: none; font-size: 13px; text-align: center; color: #fff\">");
		sb.append("<li style=\"width: 20%; float: left; background: #669542; padding: 4px 0px;\">低分险</li>");
		sb.append("<li style=\"width: 20%; float: left; background: #9ab156; padding: 4px 0px;\">中分险</li>");
		sb.append("<li style=\"width: 20%; float: left; background: #f08c2f; padding: 4px 0px;\">高分险</li>");
		sb.append("<li style=\"width: 20%; float: left; background: #f15a2a; padding: 4px 0px;\">极高分险</li>");
		sb.append("<li style=\"width: 20%; float: left; background: #ee2928; padding: 4px 0px;\">确诊疾病</li>");
		sb.append(
				"</ul></div><div style=\"clear: both; padding-top: 18px; margin: 0px 30px 0 30px; font-size: 14px;\">");
		sb.append("<span style=\"font-weight: bold\">本次</span>");
		sb.append(
				"<span style=\"display: inline-block; width: 100px; color: #f00; border-bottom: 1px solid #f00; padding-left: 10px;\">乳腺癌</span>");
		sb.append("<span style=\"font-weight: bold\">危险评论结果为：</span>");
		sb.append(
				"<span style=\"display: inline-block; width: 200px; color: #f00; border-bottom: 1px solid #f00; padding-left: 10px\">【rxaResult】</span></div>");
		sb.append(
				"<div style=\"padding-top: 20px\"><span style=\"margin-left: 30px; color: #6cc0e7; display: inline-block;\"><b>预防要点</b></span>");
		sb.append(
				"<span style=\"padding-left: 8px; color: #e6e7e9\">///////////////////////////////////////////////////////////////////////</span>");
		sb.append("<div style=\"margin: 0 30px; color: #464646; font-size: 14px; line-height: 28px\">");
		sb.append("<p style=\"margin: 0px; padding: 0px;\"><span style=\"color: #333\">【饮食】</span>");
		sb.append("饮食上应减少食盐的摄取量，适当增加钙的补充。在肉食方面应尽量选用鱼肉。因为鱼肉所含不饱和脂肪酸比较多，可以抑制其他动物油中饱和脂肪酸的吸收。平时饮酒量应限制在每日50 毫升以内, 绝对禁止酗酒。");
		sb.append("</p><p style=\"margin: 0px; padding: 0px;\"><span style=\"color: #333\">【运动】</span>");
		sb.append("坚持体育锻炼，积极参加社交活动，避免和减少精神、心理紧张因素，保持心态平和。</p>");
		sb.append(
				"<p style=\"margin: 0px; padding: 0px;\"><span style=\"color: #333\">【心态】</span>建立良好的生活方式，调整好生活节奏，保持心情舒畅</p>");
		sb.append("</div></div><div style=\"margin: 0 30px; margin-top: 25px\">");
		sb.append(
				"<img src=\"smile.png\" style=\"position: relative; float: left; margin-top: -10px; width: 35px; height: 35px;\"/>");
		sb.append(
				"<span style=\"color: #e94340; display: inline-block; float: left; margin-top: -20px; padding-left: 20px\"><b>提示:</b></span>");
		sb.append(
				"<p style=\"font-size: 12px; background: #3aa5de; color: #fff; line-height: 20px; padding: 6px 15px\">");
		sb.append(
				"&nbsp;本评估根据您当前的生活习惯和体检数据，分析您在未来5-10年内患病的风险状况。风险程度与个人生活习惯有关，希望您通过控制危险因素，有效降低患病风险。本结论属于趋势性分析，不作为诊断或治疗依据。");
		sb.append("</p></div>");
		return sb.toString();
	}

	/**
	 * 男性乳腺癌参数拼接
	 * 
	 * @param riskFactorsList
	 * @return
	 */
	public static String manRxa(List<Map<String, Object>> riskFactorsList) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < riskFactorsList.size(); i++) {
			if (!"4".equals(riskFactorsList.get(i).get("type").toString())) {
				continue;
			}
			if (i % 2 == 0) {
				sb.append("<tr style=\"background:#cfe0f1;color:#1176a8\">");
			} else {
				sb.append("<tr>");
			}
			sb.append("<td width=\"25%\" style=\"border-right: 1px solid #e1ecf7;\">"
					+ riskFactorsList.get(i).get("name") + "</td>");
			sb.append("<td width=\"25%\" style=\"border-right: 1px solid #e1ecf7;\"></td>");
			sb.append("<td width=\"25%\" style=\"border-right: 1px solid #e1ecf7;\">--</td>");
			sb.append("<td width=\"25%\">--</td></tr>");
		}
		return sb.toString();
	}

	/**
	 * 乳腺癌参数部分
	 */
	public static String getResultForRXA(Map<String, String> rfMap, int result) {
		result -= 7.76f;
		for (Entry<String, String> entry : rfMap.entrySet()) {
			String code = entry.getKey();// 指标
			String medicalCalue = entry.getValue();// 体检结果
			if (StringUtil.isEmpty(medicalCalue)) {
				continue;
			}
			if ("xueli".equals(code)) {
				String xl = "0";
				switch (medicalCalue) {
				case "小学":
					xl = "1";
					break;
				case "初级中学":
					xl = "2";
					break;
				case "中等职业":
					xl = "3";
					break;
				case "普通高中":
					xl = "4";
					break;
				case "大学专科":
					xl = "5";
					break;
				case "大学本科":
					xl = "6";
					break;
				case "研究生":
					xl = "7";
					break;
				case "博士":
					xl = "8";
					break;
				default:
					break;
				}
				result += Float.parseFloat(xl) * 2.177f;
			} else if ("rxjb".equals(code) && !"无".equals(medicalCalue)) {
				result += 1 * 3.173f;
			} else if ("rxbsss".equals(code) && !"无".equals(medicalCalue)) {
				result += 1 * 2.2f;
			} else if ("ccnl".equals(code) && !"无".equals(medicalCalue) && MatcherUtil.isShu(medicalCalue)) {
				if (Integer.parseInt(medicalCalue) >= 12 && Integer.parseInt(medicalCalue) <= 13) {
					result -= 1 * 0.482f;
				} else if (Integer.parseInt(medicalCalue) < 12) {
					result -= 2 * 0.482f;
				}
			} else if ("chnl".equals(code) && !"无".equals(medicalCalue) && MatcherUtil.isShu(medicalCalue)) {
				if (Integer.parseInt(medicalCalue) >= 20 && Integer.parseInt(medicalCalue) <= 24) {
					result += 1 * 0.114f;
				} else if (Integer.parseInt(medicalCalue) >= 25 && Integer.parseInt(medicalCalue) <= 29) {
					result += 2 * 0.114f;
				} else if (Integer.parseInt(medicalCalue) >= 30) {
					result += 3 * 0.114f;
				}
			} else if ("spsrl".equals(code) && !"无".equals(medicalCalue) && !"否".equals(medicalCalue)) {
				result -= 1 * 2.916f;
			} else if ("cjsyp".equals(code) && !"无".equals(medicalCalue) && !"否".equals(medicalCalue)) {
				result += 1 * 1.849f;
			} else if ("oy1".equals(code) && !"无".equals(medicalCalue) && !"否".equals(medicalCalue)) {
				result += 1 * 0.974f;
			} else if ("oy2".equals(code) && !"无".equals(medicalCalue) && !"否".equals(medicalCalue)) {
				result += 1 * 0.528f;
			}
		}

		result = 1 - result;
		double s = (float) 1 / (1 + Math.exp(result));
		DecimalFormat format = new DecimalFormat("0.00");
		String score1 = format.format(s);
		float _score = Float.parseFloat(score1);

		String _result = "0:0";
		if (_score <= 0.076) {
			_result = "低风险:1";
		} else if (_score > 0.076 && _score < 0.243) {
			_result = "中风险:2";
		} else if (_score >= 0.243) {
			_result = "高风险:3";
		}
		return _result;
	}

	/**
	 * 
	 * @param medical
	 *            体检结果
	 * @param wjMap
	 *            问卷
	 * @param contentMap
	 *            体检指标
	 * @param sex
	 *            性别
	 * @return 主要健康问题部分
	 */
	public static Map<String, String> health(String medical, Map<String, String> wjMap,
			Map<String, BuzMedicalContent> contentMap, int sex) {
		Map<String, String> map = new HashMap<String, String>();
		Map<String, String> subjectsMap = JsonUtil.jsonStringToMap(medical);

		String importantProblem = "";// 重要问题
		String secondaryProblem = "";// 次要问题
		// 问卷中取值
		String secondaryProblemContent = "痛风,帕金森,慢性鼻炎,过敏性鼻炎,胃炎,慢性结肠炎,便秘,风湿性关节炎,肩周炎,双膝关节退行性病变,腹外疝,肺心病,风湿性心脏病,脑血管梗塞,脑部微血管阻塞、主动脉硬化,慢性支气管炎,支气管扩张,肺气肿,肺动脉瓣关闭不全,月经不调,月经不调,下肢静脉曲张,外痔,内痔";
		// 体检报告中取值
		String generalProblem = "";// 一般问题
		String pastMedicalHistory = wjMap.get("pastMedicalHistory");// 既往史
		if (pastMedicalHistory.contains("高血压")) {
			importantProblem += "高血压,";
		} else if (!pastMedicalHistory.contains("高血压")
				&& (Integer
						.parseInt(StringUtil.isEmpty(subjectsMap.get("体检血压(收缩压)")) ? "0"
								: subjectsMap.get("体检血压(收缩压)")) > 140
						|| Integer.parseInt(StringUtil.isEmpty(subjectsMap.get("体检血压(舒张压)")) ? "0"
								: subjectsMap.get("体检血压(舒张压)")) > 90)) {
			importantProblem += "高血压,";
		} else if (pastMedicalHistory.contains("糖尿病")) {
			importantProblem += "糖尿病,";
		} else if (!pastMedicalHistory.contains("糖尿病") && Float.parseFloat(
				StringUtil.isEmpty(subjectsMap.get("空腹血糖(FPG)")) ? "0" : subjectsMap.get("空腹血糖(FPG)")) > 7.0) {
			importantProblem += "糖尿病,";
		} else if (pastMedicalHistory.contains("冠心病")) {
			importantProblem += "冠心病,";
		}
		map.put("importantProblem", StringUtil.isEmpty(importantProblem) ? "暂无"
				: importantProblem.substring(0, importantProblem.length() - 1));
		// ----------------重要问题结束----------------//
		if (pastMedicalHistory.contains("高脂血症")) {
			secondaryProblem += "高脂血症,";
		} else if (!pastMedicalHistory.contains("高脂血症")) {
			String gzxz = "总胆固醇(TC),低密度脂蛋白胆固醇(LDL-CHO),甘油三酯(TG)";
			for (String _gzxz : gzxz.split(",")) {
				BuzMedicalContent bmc = contentMap.get(_gzxz);
				if (bmc != null) {
					String min = "";
					String max = "";
					if (sex == 1) {
						max = bmc.getScopeManMax();
					} else if (sex == 2) {
						max = bmc.getScopeWomenMax();
					} else {
						max = bmc.getScopeManMax();
					}
					try {
						if (Float.parseFloat(subjectsMap.get(_gzxz)) > Float.parseFloat(max)) {
							secondaryProblem += "血脂异常,";
							break;
						}
					} catch (Exception e) {
						continue;
					}
				}
			}
		} else if (pastMedicalHistory.contains("高尿酸血症")) {
			secondaryProblem += "高尿酸血症,";
		}
		String tz = StringUtil.isEmpty(subjectsMap.get("体重指数")) ? "0" : subjectsMap.get("体重指数");
		if (Float.parseFloat(tz) > 24 && Float.parseFloat(tz) < 27.9) {
			secondaryProblem += "体重超重,";
		} else if (Float.parseFloat(tz) > 27.9) {
			secondaryProblem += "肥胖,";
		} else if (Float.parseFloat(tz) < 18.5) {
			secondaryProblem += "体重过轻,";
		}
		for (String spc : secondaryProblemContent.split(",")) {
			if (pastMedicalHistory.contains(spc)) {
				secondaryProblem += spc + ",";
			}
		}
		map.put("secondaryProblem", StringUtil.isEmpty(secondaryProblem) ? "暂无"
				: secondaryProblem.substring(0, secondaryProblem.length() - 1));
		// ----------------次要问题结束----------------//
		if (pastMedicalHistory.contains("骨质疏松")) {
			generalProblem += "骨质疏松,";
		} else if (pastMedicalHistory.contains("骨质增生")) {
			generalProblem += "骨质增生,";
		} else if (pastMedicalHistory.contains("白内障")) {
			generalProblem += "白内障,";
		}
		map.put("generalProblem",
				StringUtil.isEmpty(generalProblem) ? "暂无" : generalProblem.substring(0, generalProblem.length() - 1));
		// ------------------一般问题结束--------------//
		return map;
	}

	public static void main(String[] args) {
		// DecimalFormat format = new DecimalFormat("0.00");//本例实现小数点后保留六位有效数字
		// String result = format.format((float)1/18);
		// System.err.println(result);

	}
}
